Optimal. Leaf size=91 \[ -\frac {3 \tanh ^{-1}(\sin (e+f x)) \sqrt {a \cos ^2(e+f x)} \sec (e+f x)}{2 f}+\frac {3 \sqrt {a \cos ^2(e+f x)} \tan (e+f x)}{2 f}+\frac {\sqrt {a \cos ^2(e+f x)} \tan ^3(e+f x)}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3255, 3286,
2672, 294, 327, 212} \begin {gather*} \frac {\tan ^3(e+f x) \sqrt {a \cos ^2(e+f x)}}{2 f}+\frac {3 \tan (e+f x) \sqrt {a \cos ^2(e+f x)}}{2 f}-\frac {3 \sec (e+f x) \sqrt {a \cos ^2(e+f x)} \tanh ^{-1}(\sin (e+f x))}{2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 212
Rule 294
Rule 327
Rule 2672
Rule 3255
Rule 3286
Rubi steps
\begin {align*} \int \sqrt {a-a \sin ^2(e+f x)} \tan ^4(e+f x) \, dx &=\int \sqrt {a \cos ^2(e+f x)} \tan ^4(e+f x) \, dx\\ &=\left (\sqrt {a \cos ^2(e+f x)} \sec (e+f x)\right ) \int \sin (e+f x) \tan ^3(e+f x) \, dx\\ &=\frac {\left (\sqrt {a \cos ^2(e+f x)} \sec (e+f x)\right ) \text {Subst}\left (\int \frac {x^4}{\left (1-x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac {\sqrt {a \cos ^2(e+f x)} \tan ^3(e+f x)}{2 f}-\frac {\left (3 \sqrt {a \cos ^2(e+f x)} \sec (e+f x)\right ) \text {Subst}\left (\int \frac {x^2}{1-x^2} \, dx,x,\sin (e+f x)\right )}{2 f}\\ &=\frac {3 \sqrt {a \cos ^2(e+f x)} \tan (e+f x)}{2 f}+\frac {\sqrt {a \cos ^2(e+f x)} \tan ^3(e+f x)}{2 f}-\frac {\left (3 \sqrt {a \cos ^2(e+f x)} \sec (e+f x)\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (e+f x)\right )}{2 f}\\ &=-\frac {3 \tanh ^{-1}(\sin (e+f x)) \sqrt {a \cos ^2(e+f x)} \sec (e+f x)}{2 f}+\frac {3 \sqrt {a \cos ^2(e+f x)} \tan (e+f x)}{2 f}+\frac {\sqrt {a \cos ^2(e+f x)} \tan ^3(e+f x)}{2 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.14, size = 55, normalized size = 0.60 \begin {gather*} \frac {a \left (-3 \tanh ^{-1}(\sin (e+f x)) \cos (e+f x)+(2+\cos (2 (e+f x))) \tan (e+f x)\right )}{2 f \sqrt {a \cos ^2(e+f x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 7.00, size = 84, normalized size = 0.92
method | result | size |
default | \(-\frac {a \left (-4 \left (\cos ^{2}\left (f x +e \right )\right ) \sin \left (f x +e \right )-2 \sin \left (f x +e \right )+\left (-3 \ln \left (\sin \left (f x +e \right )-1\right )+3 \ln \left (1+\sin \left (f x +e \right )\right )\right ) \left (\cos ^{2}\left (f x +e \right )\right )\right )}{4 \cos \left (f x +e \right ) \sqrt {a \left (\cos ^{2}\left (f x +e \right )\right )}\, f}\) | \(84\) |
risch | \(-\frac {i \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, {\mathrm e}^{2 i \left (f x +e \right )}}{2 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}+\frac {i \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}}{2 \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) f}-\frac {i \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, \left ({\mathrm e}^{4 i \left (f x +e \right )}-{\mathrm e}^{2 i \left (f x +e \right )}\right )}{f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}+\frac {3 \ln \left ({\mathrm e}^{i f x}-i {\mathrm e}^{-i e}\right ) \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, {\mathrm e}^{i \left (f x +e \right )}}{2 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}-\frac {3 \ln \left ({\mathrm e}^{i f x}+i {\mathrm e}^{-i e}\right ) \sqrt {\left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{2} a \,{\mathrm e}^{-2 i \left (f x +e \right )}}\, {\mathrm e}^{i \left (f x +e \right )}}{2 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}\) | \(305\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 910 vs.
\(2 (86) = 172\).
time = 0.67, size = 910, normalized size = 10.00 \begin {gather*} -\frac {{\left (2 \, {\left (\sin \left (5 \, f x + 5 \, e\right ) + 2 \, \sin \left (3 \, f x + 3 \, e\right ) + \sin \left (f x + e\right )\right )} \cos \left (6 \, f x + 6 \, e\right ) - 6 \, {\left (\sin \left (4 \, f x + 4 \, e\right ) - \sin \left (2 \, f x + 2 \, e\right )\right )} \cos \left (5 \, f x + 5 \, e\right ) + 6 \, {\left (2 \, \sin \left (3 \, f x + 3 \, e\right ) + \sin \left (f x + e\right )\right )} \cos \left (4 \, f x + 4 \, e\right ) + 3 \, {\left (2 \, {\left (2 \, \cos \left (3 \, f x + 3 \, e\right ) + \cos \left (f x + e\right )\right )} \cos \left (5 \, f x + 5 \, e\right ) + \cos \left (5 \, f x + 5 \, e\right )^{2} + 4 \, \cos \left (3 \, f x + 3 \, e\right )^{2} + 4 \, \cos \left (3 \, f x + 3 \, e\right ) \cos \left (f x + e\right ) + \cos \left (f x + e\right )^{2} + 2 \, {\left (2 \, \sin \left (3 \, f x + 3 \, e\right ) + \sin \left (f x + e\right )\right )} \sin \left (5 \, f x + 5 \, e\right ) + \sin \left (5 \, f x + 5 \, e\right )^{2} + 4 \, \sin \left (3 \, f x + 3 \, e\right )^{2} + 4 \, \sin \left (3 \, f x + 3 \, e\right ) \sin \left (f x + e\right ) + \sin \left (f x + e\right )^{2}\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} + 2 \, \sin \left (f x + e\right ) + 1\right ) - 3 \, {\left (2 \, {\left (2 \, \cos \left (3 \, f x + 3 \, e\right ) + \cos \left (f x + e\right )\right )} \cos \left (5 \, f x + 5 \, e\right ) + \cos \left (5 \, f x + 5 \, e\right )^{2} + 4 \, \cos \left (3 \, f x + 3 \, e\right )^{2} + 4 \, \cos \left (3 \, f x + 3 \, e\right ) \cos \left (f x + e\right ) + \cos \left (f x + e\right )^{2} + 2 \, {\left (2 \, \sin \left (3 \, f x + 3 \, e\right ) + \sin \left (f x + e\right )\right )} \sin \left (5 \, f x + 5 \, e\right ) + \sin \left (5 \, f x + 5 \, e\right )^{2} + 4 \, \sin \left (3 \, f x + 3 \, e\right )^{2} + 4 \, \sin \left (3 \, f x + 3 \, e\right ) \sin \left (f x + e\right ) + \sin \left (f x + e\right )^{2}\right )} \log \left (\cos \left (f x + e\right )^{2} + \sin \left (f x + e\right )^{2} - 2 \, \sin \left (f x + e\right ) + 1\right ) - 2 \, {\left (\cos \left (5 \, f x + 5 \, e\right ) + 2 \, \cos \left (3 \, f x + 3 \, e\right ) + \cos \left (f x + e\right )\right )} \sin \left (6 \, f x + 6 \, e\right ) + 2 \, {\left (3 \, \cos \left (4 \, f x + 4 \, e\right ) - 3 \, \cos \left (2 \, f x + 2 \, e\right ) - 1\right )} \sin \left (5 \, f x + 5 \, e\right ) - 6 \, {\left (2 \, \cos \left (3 \, f x + 3 \, e\right ) + \cos \left (f x + e\right )\right )} \sin \left (4 \, f x + 4 \, e\right ) - 4 \, {\left (3 \, \cos \left (2 \, f x + 2 \, e\right ) + 1\right )} \sin \left (3 \, f x + 3 \, e\right ) + 12 \, \cos \left (3 \, f x + 3 \, e\right ) \sin \left (2 \, f x + 2 \, e\right ) + 6 \, \cos \left (f x + e\right ) \sin \left (2 \, f x + 2 \, e\right ) - 6 \, \cos \left (2 \, f x + 2 \, e\right ) \sin \left (f x + e\right ) - 2 \, \sin \left (f x + e\right )\right )} \sqrt {a}}{4 \, {\left (2 \, {\left (2 \, \cos \left (3 \, f x + 3 \, e\right ) + \cos \left (f x + e\right )\right )} \cos \left (5 \, f x + 5 \, e\right ) + \cos \left (5 \, f x + 5 \, e\right )^{2} + 4 \, \cos \left (3 \, f x + 3 \, e\right )^{2} + 4 \, \cos \left (3 \, f x + 3 \, e\right ) \cos \left (f x + e\right ) + \cos \left (f x + e\right )^{2} + 2 \, {\left (2 \, \sin \left (3 \, f x + 3 \, e\right ) + \sin \left (f x + e\right )\right )} \sin \left (5 \, f x + 5 \, e\right ) + \sin \left (5 \, f x + 5 \, e\right )^{2} + 4 \, \sin \left (3 \, f x + 3 \, e\right )^{2} + 4 \, \sin \left (3 \, f x + 3 \, e\right ) \sin \left (f x + e\right ) + \sin \left (f x + e\right )^{2}\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.40, size = 77, normalized size = 0.85 \begin {gather*} -\frac {\sqrt {a \cos \left (f x + e\right )^{2}} {\left (3 \, \cos \left (f x + e\right )^{2} \log \left (-\frac {\sin \left (f x + e\right ) + 1}{\sin \left (f x + e\right ) - 1}\right ) - 2 \, {\left (2 \, \cos \left (f x + e\right )^{2} + 1\right )} \sin \left (f x + e\right )\right )}}{4 \, f \cos \left (f x + e\right )^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sqrt {- a \left (\sin {\left (e + f x \right )} - 1\right ) \left (\sin {\left (e + f x \right )} + 1\right )} \tan ^{4}{\left (e + f x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 211 vs.
\(2 (86) = 172\).
time = 0.96, size = 211, normalized size = 2.32 \begin {gather*} \frac {{\left (3 \, \log \left ({\left | \frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 2 \right |}\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right ) - 3 \, \log \left ({\left | \frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 2 \right |}\right ) \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right ) - \frac {4 \, {\left (3 \, {\left (\frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}^{2} \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right ) - 8 \, \mathrm {sgn}\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 1\right )\right )}}{{\left (\frac {1}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} + \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}^{3} - \frac {4}{\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )} - 4 \, \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )}\right )} \sqrt {a}}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int {\mathrm {tan}\left (e+f\,x\right )}^4\,\sqrt {a-a\,{\sin \left (e+f\,x\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________